#pragma once
#include <iostream>
using std::cout;
using std::endl;

class stack {
public:
	stack(int capacity = 4) {
		cout << "stack" << endl;
		a = (int*)malloc(sizeof(int) * capacity);
		size = 0;
		capacity = capacity;
	}
	inline void stackTop() {
		cout << a[size - 1] << endl;
	}
	//void stackPush(int val) {
	//	//cheack();
	//	a[size] = val;
	//	size++;
	//}
	void stackPush(int val);
	~stack() {
		cout << "~stack" << endl;
		free(a);
		a = NULL;
		size = 0;
		capacity = 0;
	}
private:
	int* a;
	int size;
	int capacity;
};